package battleOfTheSevenSeas.Client;

import java.util.ArrayList;
import java.util.Arrays;

public class Player{

	private String droneAbscisse;
	private String droneOrdonnee;
	private String playername;
	private ArrayList<String> tabAbscisse = new ArrayList<String>(Arrays.asList(
			"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"));

	public Player (String name){
		this.playername = name;
		this.droneAbscisse = "C";
		this.droneOrdonnee = "6";
	}

	public String getPlayerName(){
		return this.playername;
	}

	public String getDroneAbscisse(){
		return this.droneAbscisse;
	}

	public String getDroneOrdonnee(){
		return this.droneOrdonnee;
	}

	public void setPlayerName(String name){
		this.playername = name;
	}

	public void setDroneAbscisse(String abs){
		if (tabAbscisse.contains(abs)){
			this.droneAbscisse = abs;
		}
	}

	public void setDroneOrdonnee(String ord){
		int i = Integer.valueOf(ord);
		if ( i > 0 && i < 17){
			this.droneOrdonnee = ord;
		}
	}

	public void setDroneLocation(int abs, int ord){
		this.droneOrdonnee = String.valueOf(ord);
		this.droneAbscisse = tabAbscisse.get(abs);
	}
}

